<template>
    <n-button :type="this.row.used?'warning':undefined" @click="markUsed">已用</n-button>
    <n-divider vertical/>
    <n-button :type="this.row.deprecated?'error':undefined" @click="markDeprecated">废弃</n-button>
</template>

<script lang="ts">
export default {
    name: "ManagementCell",
    props: {
        row: {}
    },
    methods: {
        markUsed() {
            this.row.used = !this.row.used;
            if (this.row.used) {
                this.row.deprecated = false;
            }
        },
        markDeprecated() {
            this.row.deprecated = !this.row.deprecated;
            if (this.row.deprecated) {
                this.row.used = false;
            }
        }
    },
    mounted() {
    }
}
</script>

<style scoped>

</style>
